package com.uploadfile.controller;

import com.uploadfile.pojo.bgWallImg;
import com.uploadfile.service.bgWallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/photo")
public class photoController {
    @Autowired
    private bgWallService bgWallService;

    @GetMapping("/album")
    public ModelAndView album() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("album");
        return modelAndView;
    }

    @GetMapping("/solid")
    public ModelAndView solid() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("solid");
        return modelAndView;
    }

    @GetMapping("/bgWall")
    public ModelAndView bgWall() {
        List<bgWallImg> list = bgWallService.findAll();
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("bgWall");
        modelAndView.addObject("list", list);
        return modelAndView;
    }
}
